<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
    <title>彩票</title>
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
        }

        body {
            font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #fafafa;
        }

        html {
            font-size: 16px;
        }

        @media (min-width: 40em) {
            html {
                font-size: 110%;
            }
        }

        @media (min-width: 60em) {
            html {
                font-size: 130%;
            }
        }

        .un-style-list {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        .clearfix:before,
        .clearfix:after {
            display: table;
            content: "";
        }

        .clearfix:after {
            clear: both;
        }

        .text-default {
            color: #FF3629;
        }

        /*#region top nav*/
        .top-nav {
            width: 100%;
            overflow: auto;
            background-color: #fff;
        }

        .top-nav ul {
            padding: .75em 0;
            min-width: 22.5em;
            border-bottom: 1px solid #ccc;
        }

        .top-nav li {
            float: left;
            width: 5.625em;
            line-height: 1em;
            font-size: 1em;
            position: relative;
            text-align: center;
            border-right: 1px solid #ccc;
            box-sizing: border-box;
        }

        .top-nav li.on {
            color: #FF3629;
        }

        .top-nav li.on:before {
            content: '';
            width: 100%;
            height: 3px;
            background-color: #FF3629;
            position: absolute;
            left: 0;
            bottom: -.75em;
        }

        .top-nav li:last-of-type {
            border-right: none;
        }

        .top-nav li .badge {
            border-radius: 3px;
            margin-left: 4px;
        }

        .top-nav li .badge.badge-default {
            color: #fff;
            background-color: #FF3629;
        }

        /*#endregion top nav*/

        /*#region container*/
        .container .list {
            padding: .625em;
        }

        .container .list li {
            float: left;
            padding: .625em;
        }

        .container .list .list-item {
            display: inline-block;
            width: 1.875em;
            height: 1.875em;
            line-height: 1.875em;
            border-radius: 50%;
            border: 1px solid #ccc;
            text-align: center;
            color: #FF3629;
        }

        .container .list .list-item.on {
            color: #fff;
            background-color: #FF3629;
            border-color: #FF3629;
        }

        /*#endregion container*/

        /*#region footer*/
        .footer {
            position: absolute;
            bottom: 0;
            border-top: 1px solid #ccc;
            padding: 0 20px;
            width: 100%;
            text-align: center;
            box-sizing: border-box;
        }

        .footer .footer__info {
            height: 1.625em;
            line-height: 1.625em;
            font-size: .75em;
            color: #999;
            border-bottom: 1px solid #ccc;
        }

        .footer .footer__submit {
            height: 3.125em;
            margin: 0 -.625em;
        }

        .footer .footer__submit .footer__submit--item {
            float: left;
            padding: .625em;
            height: 100%;
            box-sizing: border-box;
        }

        .footer .footer__submit .footer__submit--item:first-of-type {
            width: 30%;
        }

        .footer .footer__submit .footer__submit--item:last-of-type {
            width: 70%;
        }

        .footer .footer__submit--item a {
            display: block;
            width: 100%;
            height: 100%;
            border-radius: 5px;
            text-decoration: none;
            font-size: .8em;
            font-weight: bold;
            line-height: 2.34325;
        }

        .footer .footer__submit--item .footer__submit--random {
            border: 1px solid #ccc;
            color: #FF3629;
        }

        .footer .footer__submit--item .footer__submit--btn {
            background-color: #FF3629;
            color: #fff;
        }

        /*#endregion footer*/
    </style>
</head>
<body>
<nav class="top-nav">
    <ul class="un-style-list clearfix">
        <li class="on">选第1位<span class="badge badge-default">奖</span></li>
        <li>选2全中</li>
        <li>选3全中<span class="badge badge-default">奖</span></li>
        <li>选4全中</li>
    </ul>
</nav>

<div class="container">
    <ul class="list un-style-list clearfix">
        <li><span class="list-item" data-value="1">1</span></li>
        <li><span class="list-item" data-value="2">2</span></li>
        <li><span class="list-item" data-value="3">3</span></li>
        <li><span class="list-item" data-value="4">4</span></li>
        <li><span class="list-item" data-value="5">5</span></li>
        <li><span class="list-item" data-value="6">6</span></li>
        <li><span class="list-item" data-value="7">7</span></li>
        <li><span class="list-item" data-value="8">8</span></li>
        <li><span class="list-item" data-value="9">9</span></li>
        <li><span class="list-item" data-value="10">10</span></li>
        <li><span class="list-item" data-value="11">11</span></li>
    </ul>
</div>

<div class="footer">
    <div class="footer__info">
        猜中任意三个开奖号码，单注奖<span class="text-default">26元</span>，再加奖<span class="text-default">4元</span>
    </div>
    <div class="footer__submit">
        <div class="footer__submit--item">
            <a class="footer__submit--random" href="#">随机一注</a>
        </div>
        <div class="footer__submit--item">
            <a class="footer__submit--btn" href="#">至少选择2个球</a>
        </div>
    </div>
</div>

<script type="text/javascript">
    (function (global) {
        var $ = {
            hasClass: function (ele, className) {
                var classNames = (ele.className || '').split(' ');
                return classNames.some(function (item) {
                    return item === className;
                });
            },
            addClass: function (ele, className) {
                if ($.hasClass(ele, className)) {
                    return;
                }
                var names = (ele.className || '').split(' ').concat(className);
                ele.className = names.filter(function (item) {
                    return !!item;
                }).join(' ');
            },
            removeClass: function (ele, className) {
                var names = (ele.className || '').split(' ').filter(function (item) {
                    return item !== className;
                });
                ele.className = names.join(' ');
            },
            toggleClass: function (ele, className) {
                $.hasClass(ele, className) ? $.removeClass(ele, className) : $.addClass(ele, className);
            }
        };
        global.$ = $;
    })(window);

    document.querySelector('.top-nav ul').addEventListener('click', function (e) {
        var li = e.target.tagName.toLowerCase() === 'li' ? e.target : e.target.parentElement;
        $.toggleClass(li, 'on');
    }, false);
</script>
</body>
</html>